package com.dk.lambda;

public class Test {
    public static void main(String[] args) {
        LambdaService l = new LambdaService() {
            @Override
            public void test() {
                System.out.println("说英语");
            }
        };
        l.test();
        LambdaService l1 =new LambdaService() {
            @Override
            public void test() {
                System.out.println("说汉语");
            }
        };
        l1.test();
        LambdaService l2 = ()-> System.out.println("说日语");
        l2.test();
        LambdaService1 l3 = new LambdaService1() {
            @Override
            public void test2(String x, Integer y) {
                System.out.println(x+y);
            }
        };
            l3.test2("张三",18);
        LambdaService1 l4 =(x,y)->{
            System.out.println(x);
            System.out.println(y);
        };
        l4.test2("王强的年龄是",90);
        LambdaService2 l5 =(x,y)->{
            Double sum = x+y;
            System.out.println(sum);
            return "计算成功";
        };
        String s = l5.test3(89.1, 56.78);
        System.out.println(s);
        LambdaService3 l6 =x ->x = "zhangsan";
        String zhou = l6.test4("zhou");
        System.out.println(zhou);
        LambdaService4 l7=(x,y)->x+y;
        Integer integer = l7.test5(15, 89);
        System.out.println("sum为"+integer);
        LambdaService3 l9 =(x)->{
         return ("54");
        };
    }
}

